1. Field of Invention
The present invention generally relates to a high quality quantizing/inverse-quantizing algorithm suitable for audio encoding/decoding and t same, and more particularly, to a method that performs a nonlinear operation in the quantization/anti-quantization of the audio encoding/decoding and the hardware applying the same.
2. Description of Related Art
Digital audio signal processing is widely applied now. Noise immunity capability of digital audio signals such as the video telephone, the videoconference, and the multimedia system are stronger than that of analog audio signals. However, since quite often a great amount of data is processed in a very short time frame, but still has to maintain high quality, good audio signal compression and decoding techniques have become inevitable. The motion picture experts group (MPEG) is well accepted now due to its high compression and low distortion rate.
FIG. 1A schematically shows an MPEG encoding process. In the encoding process, the analysis subband filter bank 100 is used to process the digital audio data that represents the time-amplitude relationship to generate the 32 subband frequency-field data that represent the frequency-amplitude. The data with different band is subsequently assigned a different bit according to the psycho-acoustical model 110, and then the quantization 120 is processed to achieve the objective of the frequency-filed data compression. Finally, the compressed data is sent out with a data format of certain framing.
FIG. 1B schematically shows an MPEG decoding process. The decoding process is just like an inverse operation of the encoding process. In the decoding process, the data is unpacked 200 as compressed data first, and subsequently decompressed by inverse quantization 210, and finally the synthesis subband filter bank 220 is used to integrate the data with 32 subbands to generate the original digital audio data.
Nonlinear operation is needed in both the process of the quantization for the MPEG encoding and the process of the inverse quantization for the MPEG decoding. In other words, the non-integer exponential operation is performed to amplify or compress the energy corresponding to the sampling point of the frequency.
FIG. 2A schematically shows an exponential operation equation curve of the quantization that is shown below, and FIG. 2B schematically shows an exponential operation equation curve of the inverse quantization that is shown below.
⊚ The exponential operation equation for the MPEG quantization process: f(X)=X3/4 Where X represents the amplitude of the frequency sampling point, i.e. the frequency-field sampling data, and f(X) is the amplified or the compressed sampling data of the frequency-field.
⊚ The exponential operation equation for the MPEG inverse quantization process:
f(X)=X4/3
Where X represents the inverse package data, and f(X) is the corresponding value of the inverse package data.
Although the exponential operation equation mentioned above can be directly calculated via the software, it is very difficult to implement it by using the hardware (since it is a non-integer exponential operation). Therefore, there is a method for building up the corresponding table, so that the value of the corresponding f(X) can be obtained from a table via a query operation after the frequency-field sampling data X is input. However, this method can only deal with a certain range of the frequency-field sampling data. If it is assumed that 256 frequency-field sampling data X and the value of each corresponding f(X) have been built up, the value of the corresponding f(X) of the frequency-field sampling data can be obtained only when X is in a range of 1xcx9c256. If X is beyond 256, the value of the corresponding f(X) of the frequency-field sampling data cannot be obtained via the query operation.
The corresponding table has to be expanded to solve the problem mentioned above. However, it increases the hardware cost and the hardware volume of the integrated circuit. Therefore, some algorithms have been disclosed to solve the insufficiency of the corresponding table. These algorithms approach the nonlinear equations mentioned above by using the estimation method. However, these algorithms will generate error or may need to add an additional multiplier circuit.
Therefore, the present invention provides a nonlinear operation method suitable for the audio encoding/decoding and the hardware applying the same. The corresponding table does not have to be expanded increasing the hardware cost and having the integrated circuit volume become larger and neither is it necessary to add an additional multiplier for reducing error.
The present invention provides a nonlinear operation method suitable for the audio encoding/decoding. The method exists in a quantization process for the audio encoding. The nonlinear operation equation is f(X)=X3/4, where X represents the frequency-field data. The method comprises the following steps. Building a query table that comprises the frequency-field data X and the corresponding value f(X) that corresponds to the frequency-field data X. The query table is represented as a function T(X), and T(X)=X3/4, 1xe2x89xa6Xxe2x89xa6S, where S represents a data range included in the query table. Analyzing and providing a modified error quantity function fa(z) represented by an equation of power of 2, where       z    =          ⌊              X                  16          n                    ⌋        ,
n=1, 2 or 3, so that z falls in the data range S. When the frequency-field data X intended to be queried is greater than the data range S, the value of T(z) and T(z+1) are obtained from the query table and defined as Y1 and Y2, respectively. The value of f(X) corresponding to any one of the frequency-field data X outside the data range S is subsequently calculated by using the two-phase interpolation method.
The present invention further provides a nonlinear operation method suitable for the audio decoding. The method exists as a process of inverse quantization for the audio decoding. The nonlinear operation equation is f(X)=X4/3, where X represents the inverse package data. The method comprises the following steps. Building a query table that comprises a plurality of inverse package data X and a corresponding value f(X) that corresponds to the inverse package data X. The query table is represented as a function T(X), and T(X)=X4/3, 1xe2x89xa6Xxe2x89xa6S, where S represents a data range included in the query table. Analyzing and providing a modified error quantity function fa(z) represented by an equation of power of 2, where       z    =          ⌊              X                  8          n                    ⌋        ,
n=1 or 2, so that z falls in the data range S of the query table. When the inverse package data X intended to be queried is greater than the data range S, the value of T(z) and T(z+1) are obtained from the query table and defined as Y1 and Y2, respectively, where z and (z+1) respectively fall in the data range S of the query table. Afterwards, the value of f(X) corresponding to any one of the inverse package data X outside the data range S is calculated by using a two-phase interpolation method.
The present invention further provides an applied hardware for the nonlinear operation equation suitable for the audio encoding/decoding. The applied hardware is in an MPEG integrated circuit and is used to solve a nonlinear operation equation that is needed in the process of quantization/inverse quantization. The applied hardware for the nonlinear operation equation suitable for the audio encoding/decoding comprises a shifter, a read only memory (ROM), a difference calculator, a modified error quantity function generator, and an interpolation method calculator.
The shifter receives the sampling data X, applies the right-shift operation on the received sampling data X to obtain the operation sampling data z, and further has the operation sampling data z fall in the data range S. The read only memory stores a query table that includes the data range S, wherein the query table is represented as a function T(X). After the read only memory receives the operation sampling data z, the value of T(z) and T(z+1) are output and defined as Y1 and Y2, respectively, where z and (z+1) respectively fall in the data range S of the query table. The difference calculator coupled to the read only memory obtains a difference value of (Y2-Y1) after receiving Y1 and Y2, and performs a power of 2 operation onto the difference value to obtain an original difference. The modified error quantity function generator coupled to the shifter obtains a modified error quantity function fa(z) via the subtraction and the shift operation after receiving the operation sampling data z. The interpolation method calculator receives the original difference and the modified error quantity function fa(z) mentioned above, performs the summation/subtraction operation, selection process, coefficient multiply operation, and shift operation to obtain the nonlinear operation value corresponding to the sampling data X.
In summary, the present invention performs the two-phase interpolation method by using some simple adder or shift circuit under the fixed size of the corresponding table, so that the error can be reduced without adding any additional new multiplier circuit.